home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / Visual Cafe Pro v1.0 / SOURCE.BIN / RecordStateLabel.java < prev    next >
Encoding:
Java Source  |  1997-06-19  |  1.7 KB  |  77 lines

  1. /*
  2.  *
  3.  * 4     12/20/96 2:18a Tjones
  4.  * Changed empty constructor for jblender
  5.  *
  6.  * 3     11/15/96 11:46a Cthrons
  7.  * Renamed bind to setRelationView
  8.  *
  9.  * 2     11/15/96 11:09a Cthrons
  10.  * Added bind method.
  11.  *
  12.  * 1     11/15/96 11:00a Cthrons
  13. */
  14.  
  15. package symantec.itools.db.awt;
  16.  
  17. // import java.awt.*;
  18. import java.util.*;
  19. import symjava.sql.*;
  20. import java.lang.*;
  21. import symantec.itools.db.net.*;
  22. import symantec.itools.db.pro.*;
  23.  
  24. /**
  25.  * A TextField object is a single-line area that displays text.
  26.  * It can be bound to a projection in a database.
  27.  * It can be set to allow editing or read-only modes.
  28.  *
  29.  */
  30. public class RecordStateLabel extends java.awt.Label implements RecordLink
  31. {
  32.     /**
  33.      * The ProjBinder object which this component can use to get data from
  34.      * the server, or change data at the database server.
  35.      */
  36.     ProjBinder m_ProjBinder;
  37.  
  38.     /**
  39.      * Constructs a new TextField.
  40.      */
  41.     public RecordStateLabel()
  42.     {
  43.         super("<Record State Label>");
  44.     }
  45.  
  46.     /**
  47.      * Called when the object is bound to a RelationView
  48.      *
  49.      */
  50.     public void init ()
  51.     {
  52.         setText("Unknown");
  53.     }
  54.  
  55.     /**
  56.      * Called when the current Record in a Relationview is changed.
  57.      */
  58.     public void notifyRecordChange (Record currentRecord)throws SQLException
  59.     {
  60.         if (currentRecord != null)
  61.         {
  62.             setText(currentRecord.getStateString());
  63.         }
  64.     }
  65.  
  66.     public void setRelationView (RelationView rv)
  67.     {
  68.         try
  69.         {
  70.             rv.bindCurrentRecord(this);
  71.         }
  72.         catch (SQLException ex)
  73.         {
  74.             System.out.println(ex.getMessage());
  75.         }
  76.     }
  77. }